//
//  LodingView.swift
//  boxNearBy
//
//  Created by DW on 16/6/21.
//  Copyright © 2016年 DW. All rights reserved.
//

import UIKit

class LoadingView: UIView {
    
    @IBOutlet weak var routeImage: UIImageView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        startAnimation()
        
    }
    
    private func startAnimation (){
        let anim = CABasicAnimation(keyPath: "transform.rotation")
        anim.toValue = 2 * M_PI
        anim.duration = 5.0
        anim.repeatCount = MAXFLOAT
        anim.removedOnCompletion = false
        routeImage.layer.addAnimation(anim, forKey: nil)
    }
}
